// 拆分的modal reducer

import { HIDEMODAL, SHOWMODAL } from "../const/modal.const"

const initialState = {
  show: false
}

// 这个函数返回什么，state就是什么
export default (state = initialState, action) => {
  switch(action.type) {
    case SHOWMODAL:
      return {
        show: true
      }
    case HIDEMODAL: 
      return {
        show: false
      }
    default: 
      return state
  }
}
